class Task(object):
    def __init__(self, name="", cost=0, done=False, team=None, req = [], hard=50, days=0):
        "A software task"
        self.name = name
        self.cost = cost
        self.done = done
        if req:
            self.req = []
            for i in req:
                self.req.append(i)
        else: self.req = None
        self.team = team
        self.hard = hard
        self.loc = self.hard
        self.days = days

    def getter(self,attribute):
        return eval('self.' + attribute)

    def setter(self,attribute,val):
        exec(('self.' + attribute + ' = ' + 'val'))

    def assignTeam(self, team):
        self.team = team
        
    def __repr__(self):
        print "\n"
        print "Task: " + self.name
        print "....Cost: " + str(self.cost)
        print "....Hard: " + str(self.hard)
        print "....Done: " + str(self.done)
        if self.req:
            print "....Requirements: "
            for i in range(len(self.req)):
                print "........" + str(i+1) + ": " + self.req[i].name
        else: print "....Requirements: None"
        if self.team: print "....Team: " + self.team.name
        else: print "....Team: No Team Assigned"
        return ""

    def repr2(self):
        print "[Task] " + self.name
        print "[Team Assigned] " + self.team.name
